/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from '@/utils/request';
import { isArray } from 'lodash';

// 出库率管控，获取列表
export async function getWarehouseList(params: any) {
  return request('/OutRate/getList', {
    method: 'POST',
    data: params,
  }).then(({ data }) => {
    const { list } = data || {};
    if (isArray(list) && list.length > 0) {
      return {
        ...data,
        data: list,
      };
    }
    return {};
  });
}

// 出库率管控，操作禁用
//关闭品牌代收\关闭驿站登录\关闭驿站入库
export async function closeCollect(params: any) {
  const { url } = params;
  delete params.url;
  return request(url, {
    data: params,
    method: 'POST',
  });
}

//关闭品牌代收
export async function closeBrandCollect(params: any) {
  return request('/Inn/closeBrandCollect', {
    data: params,
    method: 'POST',
  });
}

//导出
export async function outRateExport(params: any) {
  return request('/OutRate/export', {
    data: params,
    method: 'POST',
  });
}

//获取品牌列表
export async function getBrandList() {
  return request('/Brand/getNeedAssessBrandList', {
    method: 'POST',
  });
}
